Repository navigation
build(lint): add Biome lint/format with Lefthook pre-push and CI gate - #307
Merged
Merged
Conversation
Biome lints and formats src/, scripts/ and vite.config.ts (vendored src/ds/egdev excluded). Lefthook runs biome ci and cargo fmt --check on pre-push; ci.yml and linux-pr-ci.yml run biome ci after npm ci.
CSS stays linted but not formatted: ui-theme and quota tests assert literal theme.css/styles.css text. Raw-imported provider SVGs are vendored marks validated by security tests. Two source-grep tests now accept line breaks so they do not depend on formatting.
Formatting-only commit produced by `npx biome format --write`; no behavior change. Listed in .git-blame-ignore-revs.
Equivalent rewrites: [^] -> [\s\S], non-ASCII check as a code-unit range, ??= out of expressions, forEach callbacks to for...of, renamed helpers that shadowed the escape global or the after test hook, and dropped unused exports from a test. Justified biome-ignore for the intentional throw in the notary key cleanup and the single-render capture components.
type="button" on buttons (no <form> exists, so no behavior change), forEach callbacks to for...of, and role="img" where a span carries an aria-label. Hook dependency lists are kept as they were and annotated with biome-ignore, because changing them would change when effects re-run. Also switch biome.json to the non-deprecated rules preset.
The repository policy allows no root npm lifecycle scripts, so the hook is installed with `npm run hooks:install`. Windows checkouts with core.autocrlf turned every file into CRLF and failed `biome ci`; .gitattributes now keeps the formatted extensions LF.
This was referenced Nov 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue / Issue relacionada
Issue: none (maintainer request).
ODD: not applicable to the roadmap; tracked locally in
odd/tasks/biome-lefthook.md.Scope / Alcance
Adds Biome lint/format, a Lefthook
pre-pushhook and the same check in CI.7006d90,81e387f):biome.jsoncoverssrc/,scripts/andvite.config.ts. Excluded: vendoredsrc/ds/egdev/(copy, not edited by hand) and raw-importedsrc/assets/logos/*.svg(validated by security tests). The CSS formatter is off because UI tests assert literaltheme.css/styles.csstext; CSS is still linted.lefthook.ymlpre-push runsnpx biome ciandcargo fmt --check. New scripts:lint,format,check,check:fix,hooks:install. There is nopreparescript:.github/security/policy.jsonallows no root npm lifecycle hooks, so contributors runnpm run hooks:installonce per clone..gitattributeskeeps Biome-checked files LF sobiome cidoes not fail on Windows checkouts withcore.autocrlf.ci.ymlandlinux-pr-ci.ymlrunnpx biome ciright afternpm ci.ef1b86c, 175 files): output ofnpx biome format --writeon81e387f, listed in.git-blame-ignore-revs. Two source-grep tests were made whitespace-tolerant beforehand, in81e387f.5b0075e,71119c1): 106 errors → 0. Equivalent rewrites only (type="button", no<form>exists;forEach→for...of; equivalent regexes; renames in tests). Visible change:role="img"on two spans that carry anaria-label. The 17 hook dependency lists are unchanged and annotated withbiome-ignore, because changing them would change when effects re-run. The 224 warnings stay visible and do not fail CI.Exclusions: no CSS formatting, no Rust linting (clippy), no warning cleanup.
.git-blame-ignore-revs.Coordination / Coordinación
N/A (non-ODD maintainer change). Open PRs will need
git rebase main+npm run check:fix(currently #303). A Discord notice with sync steps goes out after merge.Contributor / Contribuidor: @egdev6
Acceptance and validation / Aceptación y validación
npx biome ciexits 0 (0 errors); pre-push exits 1 with a probe lint error and 0 on the clean tree.npm test(vitest 1241/1241, node --test 329 pass / 0 fail),npm run build(includestsc --noEmit),cargo fmt --check,node scripts/i18n-inventory.mjs --check. Independent verification: format commit reproduced byte-identical from81e387f; lint fixes reviewed for semantic equivalence; Biome scope probed with fixture files.cargo test(no Rust changes). The CRLF case was reproduced locally with acore.autocrlf=trueclone:biome ciexits 0 after the.gitattributeschange.check-repository.mjspolicy check:ok: true.An open PR does not mean integration. Release, secrets and signing operations require separate authorization.
Una PR abierta no implica integración. Release, secretos y firma requieren autorización separada.